////2009/07/25 14:19:12
#include<iostream>
#include<string>
#include<vector>

using namespace std;

class PrefixCode
{
public:
    string isOne(vector <string> words)
    {
        for (int i=0; i<words.size(); i++)
        {
            for (int j=0; j<words.size(); j++)
            {
                if (i!=j && check(words[i], words[j]))
                {
                    string s = "No, ";
					// s += '0' + i; Don't forget the number more than two digits.
                    s += convertInt(i);
                    return s;
                }
            }
        }
        return "Yes";
    }
private:
    bool check(string A, string B)
    {
        if (A.size() > B.size())
            return false;
        for (int i=0; i<min(A.size(), B.size()); i++)
        {
            if (A[i]!=B[i])
                return false;
        }
        return true;
    }
    string convertInt(int number)
    {
        stringstream ss;//create a stringstream
        ss << number;//add number to the stream
        return ss.str();//return a string with the contents of the stream
    }
};
